<template>
    <div>
        <div style="height:80px;text-align:center;line-height:80px">大轮播</div>
        <nav>
            <!-- 导入方式一 -->
            <!-- <router-link to="/films/nowplaying" active-class="red">正在热映</router-link> -->
            <!-- <router-link to="/films/comingsoon" active-class="red"> 即将上映</router-link> -->
            <!-- 导入方式二 声明式导航 -->
            <router-link custom to="/films/nowplaying" v-slot="{ isActive, navigate }" >
                <span :class="isActive ? 'red' : ''" @click="navigate">正在热映</span>
            </router-link>
            <!-- 编程式导航 -->
            

            <router-link custom to="/films/comingsoon" v-slot="{ isActive, navigate }" >
                <span :class="isActive ? 'red' : ''" @click="navigate">即将上映</span>
            </router-link>
        </nav>
        <router-view></router-view>
    </div>
</template>
<style scoped lang="scss">

nav{
    display: flex;
    justify-content: space-around;
    height: 40px;
    line-height: 40px;
    align-items: center;
    border-bottom: 1px solid #EDEDED;
    a{
        text-decoration: none;
        color: #000;
        flex: 1;
        text-align: center;
        border-bottom: 2px solid transparent;
    }
    .red{
        border-bottom: 2px solid red;
    }
}
</style>